        PROGRAM ISTQD
 
        INTEGER SRCPTH(134),OUTPTH(134),PLOPTH(134),
     +          CIPTH(134),TMPPTH(134),OPTSTR(134),I,STATUS,
     +          IODSRC,IODOUT,IODTMP,TOKNUM,IODCI,NERROR,NWARN,DESCI,
     +          PLOPT(134),IODPLO
 
        INTEGER TMPFIL
 
        INTEGER YPARSE,GETARG,OPEN,CREATE,ZYINCI,ZTKPTI,ZTKGTI
        EXTERNAL YPARSE,ZINIT,ZMESS,REMARK,ZQUIT,GETARG,OPEN,CREATE,
     +           ZCHOUT,ZPTINT,PUTCH,REMOVE,SEEK,ZYINCI,ZTKPTI,ZTKGTI
 
        DATA (TMPPTH(I),I=1,11)/108,121,112,99,109,116,46,
     +116,109,112,129/,
     +       (CIPTH(I),I=1,11)/108,121,112,99,109,105,46,
     +116,109,112,129/
 
        CALL ZINIT
        CALL INISTR
        CALL INISYM
        CALL INITRE
        NERROR=0
        NWARN=0
 
        IF (GETARG(1,SRCPTH,81).EQ.-100) CALL NAMES(1,SRCPTH)
        IF (GETARG(2,OUTPTH,81).EQ.-100) CALL NAMES(2,OUTPTH)
        IF (GETARG(3,OPTSTR,81).EQ.-100) CALL NAMES(3,OPTSTR)
        IF (GETARG(4,PLOPTH,81).EQ.-100) CALL NAMES(4,PLOPTH)
 
        IODSRC=OPEN(SRCPTH,0)
        IF (IODSRC.EQ.-1) CALL ERROR('Source File Open Failed.')
        IODOUT=CREATE(OUTPTH,1)
        IF (IODOUT.EQ.-1) CALL ERROR('Output File Create Failed.')
        IODPLO=OPEN(PLOPTH,0)
 
        IODTMP=TMPFIL(TMPPTH)
        IODCI=TMPFIL(CIPTH)
        IF (IODTMP.EQ.-1 .OR. IODCI.EQ.-1)
     +      CALL ERROR('Scratch File Creation Failed.')
 
        IF (YPARSE(IODSRC,IODTMP,-1,IODCI,NERROR,NWARN).EQ.0) THEN
            IF (NERROR.GT.0) THEN
                CALL ZCHOUT('[ISTQD Terminated, .',1)
                CALL ZPTINT(NERROR,1,1)
                CALL ZCHOUT(' er'//'ror.',1)
                IF (NERROR.GT.1) CALL PUTCH(115,1)
                CALL ZMESS('].',1)
                STATUS=-1
            ELSE
                CALL SEEK(0,IODCI)
                CALL SEEK(0,IODTMP)
                IF (ZYINCI(IODCI).EQ.-1) CALL ERROR(
     +              'Internal Error: Couldn''t reread comment index')
                IF (IODPLO.NE.-1) CALL PLOPTF(IODPLO)
                DO 100 I=5,10
                    IF (GETARG(I,PLOPT,134).NE.-100)
     +                  CALL POLOPT(PLOPT,.FALSE.)
 100            CONTINUE
                DESCI=ZTKGTI(2,0,0)
                CALL DS(OPTSTR,IODTMP,ZTKPTI(0,IODOUT,DESCI),NERROR,
     +                  NWARN)
                IF (NERROR+NWARN.EQ.0) THEN
                    CALL ZMESS('[ISTQD Normal Termination].',1)
                    STATUS=-2
                ELSE IF (NERROR.EQ.0) THEN
                    CALL ZCHOUT('[ISTQD Terminated, .',1)
                    CALL ZPTINT(NWARN,1,1)
                    CALL ZCHOUT(' war'//'ning.',1)
                    IF (NWARN.GT.1) CALL PUTCH(115,1)
                    CALL ZMESS('].',1)
                    STATUS=-1002
                ELSE
                    CALL ZCHOUT('[ISTQD Terminated, .',1)
                    CALL ZPTINT(NERROR,1,1)
                    CALL ZCHOUT(' er'//'ror.',1)
                    IF (NERROR.GT.1) CALL PUTCH(115,1)
                    CALL ZMESS('].',1)
                    STATUS=-1
                END IF
            END IF
        ELSE
            CALL REMARK('[ISTQD Fatal Error -- Terminated].')
            STATUS=-1001
        END IF
 
        CALL CLOSE(IODTMP)
        CALL CLOSE(IODCI)
        CALL REMOVE(TMPPTH)
        CALL REMOVE(CIPTH)
 
        CALL ZQUIT(STATUS)
 
        END
C ----------------------------------------------------------------------
C
C       N A M E S   -   Input the pathname of a required file from stdin
C
 
        SUBROUTINE NAMES(NUMBER,PATH)
        INTEGER NUMBER,PATH(*)
 
        INTEGER JUNK,PROMPT(20,4)
 
        SAVE PROMPT
 
        INTEGER ZGTCMD
        EXTERNAL ZGTCMD,ZPRMPT
 
C "Input source file: "
C "Output file: "
C "DS options: "
C "PL option file: "
 
        DATA (PROMPT(I,1),I=1,20)/73,110,112,117,116,32,115,
     +111,117,114,99,101,32,102,105,108,101,58,
     +32,129/,
     +       (PROMPT(I,2),I=1,14)/79,117,116,112,117,116,32,
     +102,105,108,101,58,32,129/,
     +       (PROMPT(I,3),I=1,13)/68,83,32,111,112,116,105,
     +111,110,115,58,32,129/,
     +       (PROMPT(I,4),I=1,17)/80,76,32,111,112,116,105,
     +111,110,32,102,105,108,101,58,32,129/
 
        CALL ZPRMPT(PROMPT(1,NUMBER))
        JUNK=ZGTCMD(PATH,0)
 
        END
